import { FormKeys, ProFormInstance } from '@/components/ProForm/interface';
import { ProTableInstance } from '@/components/ProTable/interface';
import { TableColumnCtx } from 'element-plus';
/**
 * @description: 枚举类型
 */
export namespace PublicInterface {
  export interface PublicType {
    buttonType: 'success' | 'info' | 'warning' | 'danger' | 'primary' | 'error' | 'default';
    /**权限类型 */
    permissionType: 'button' | 'search' | 'menu' | 'public' | 'menu_public';
    /** 是 | 否 */
    yesOrNo: 1 | 0;
    /** 消息状态 */
    messageStatus: 'success' | 'warning' | 'info' | 'error';
    /** 文件预览类型 */
    filePreviewType: 'image' | 'pdf';
  }

  // 未知的对象
  export interface UnknownObjProps {
    [key: string]: any;
  }
  /** 表格 */
  export interface ProTableValue {
    value?: ProTableInstance | undefined;
  }
  /** 表单 */
  export interface ProFormValue {
    value?: ProFormInstance | undefined;
  }

  /** 树结构 */
  export type TreeDataProp<T> = {
    children?: TreeDataProp<T>[];
  } & {
    [key in FormKeys<T>]?: any;
  };

  export interface SpanMethodProps<T = any, R = any> {
    row: R;
    column: TableColumnCtx<T>;
    rowIndex: number;
    columnIndex: number;
  }
}
